package com.jianz.campus_markets.controller;

import com.jianz.campus_markets.domain.ResponseResult;
import com.jianz.campus_markets.service.ProductService;
import com.jianz.campus_markets.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Jianz
 * @version 1.0
 * @Description
 * @Email jianz8153.gmail.com
 * @Date 2023/11/22 20:59
 */

@RestController
@RequestMapping("/search")
@Api(value = "搜索模块")
public class SearchController {

    @Autowired
    private UserService userService;

    @Autowired
    private ProductService productService;

    @GetMapping("/user")
    @ApiOperation(value = "用户模糊搜索  %condition%")
    public ResponseResult userSearch(String condition){
        return userService.userSearch(condition);
    }

    @GetMapping("/product")
    @ApiOperation(value = "商品模糊搜索  %condition%")
    public ResponseResult productSearch(String condition){
        return productService.productSearch(condition);
    }


}

